MemError
(12-September-97)MemError()
always returns noErr
.
What's wrong with MemError()
?
MemError()
and in this case,
the debugger's
memory request was successful (it returned noErr
) and cleared your application's
MemError()
result.
The solution to this problem is often just to not step over Memory Manager calls and
the call to MemError()
. If you put a break point just after the
MemError()
call,
you usually get the correct error -- the one your application would see if it wasn't
running in the debugger.
The other option is to use a low level debugger such as MacsBug to debug your memory
allocation problems.NewHandle
, NewPtr
, etc: and if it is nil,
you should call MemError()
for an error number. Just calling MemError()
without checking the value of the
handle/pointer is not a good idea.